class_name GameStateFactory

var states : Dictionary

func _init() -> void:
	states = {
		GameManager.State.IN_PLAY: GameStateInPlay,
		GameManager.State.GAMEOVER: GameStateGameOver,
		GameManager.State.KICKOFF: GameStateKickoff,
		GameManager.State.OVERTIME: GameStateOverTime,
		GameManager.State.SCORED : GameStateScored,
		GameManager.State.RESET : GameStateReset
	}

func get_fresh_state(state: GameManager.State) -> GameState:
	assert(states.has(state),'state does not exists')
	return states.get(state).new()
